// by: 陈同学
#include <iostream>
using namespace std;
template<typename T>;
T sort(T* p, int n)
{
    for (int i = 0; i < n; i++)
    {
        for (int j = i; j < n; j++)
        {
            if (p[i] > p[j])
            {
                T temp;
                temp = p[j];
                p[j] = p[i];
                p[i] = temp;
            }
        }
    }
      for (int k = 0; k < n; k++)
      {
        cout << p[k] << " ";
      } 
}
int main()
{
    cout<<"Please which kind number you want to input"<<endl;
    cout<<"1.int\n2.float\n3.double\n";
    int choose;
    cin>>choose;
    cout<<"How many number you want to enter:"<<endl;
    int n;
    cin>>n;
    if (choose == 1)
    {
        int* p = new int[n];
        for (int i = 0; i < n; i++)
            cin >> p[i];
        sort(p, n);
    }

    if (choose == 2)
    {
        double* p = new double[n];
        for (int i = 0; i < n; i++)
            cin >> p[i];
        sort(p, n);

    }
    if (choose == 3)
    {
        float* p = new float[n];
        for (int i = 0; i < n; i++)
            cin >> p[i];
        sort(p, n);
    }
}
